package com.situ.hr4.w.controller;

import com.situ.hr4.pojo.Users;
import com.situ.hr4.w.service.Dlservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.Map;

@Controller
public class Denglucontroller {

    @Autowired
    Dlservice dl;

    @PostMapping("denglu")
    public String dlcg(Users u, Map map){
        u=dl.pd(u);
        if(u==null){
            map.put("s", "用户名或密码错误");
            return "login.html";
        }else {
            map.put("user", u);
            return "page/index.html";
        }
    }
}
